/*
 * utilities.cpp
 *
 *  Created on: Jan 16, 2014
 *      Author: tbergmueller
 */


#include "utilities.h"
#include <iostream>
#include <opencv2/highgui/highgui.hpp>

using namespace cv;
using namespace std;


void loadBitmaps(string prefix, int amount, vector<Mat>& output_images)
{
	output_images.clear();

	cout << "Load " << amount << " images from " << prefix << "... " << endl;

	for(int i=1; i<= amount; i++)
	{
		stringstream ss;
		ss << prefix << i << ".bmp";

		Mat buff = imread(ss.str(), CV_LOAD_IMAGE_GRAYSCALE);

		if(buff.empty())
		{
			cerr << "Could not load image " << ss.str() << "... Aborting... " << endl;
			output_images.clear();
			return;
		}

		output_images.push_back(buff);
	}
}
